<?php

declare(strict_types=1);

namespace Modules\Production\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $order_id
 * @property $material_no
 * @property $unit
 * @property $qty
 * @property $location
 * @property $lot_num
 * @property $pick_order_no
 * @property $pick_order_id
 * @property $wms_code
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
*/
class MaterialReturnDetail extends Model
{


    protected $table = 'material_return_detail';

    protected $fillable = [ 'id','org_code','cargo_type','cargo_code', 'order_id', 'material_no','supplier_code', 'unit', 'qty', 'location', 'lot_num','plan_order_no', 'pick_order_no', 'pick_order_id', 'wms_code', 'creator_id', 'created_at', 'updated_at', 'deleted_at' ];

    /**
     * @var array
     */
    protected array $fields = ['id','org_code','cargo_type','cargo_code','order_id','material_no','supplier_code','unit','qty','location','lot_num','plan_order_no','pick_order_no','pick_order_id','wms_code','created_at','updated_at'];

    /**
     * @var array
     */
    protected array $form = ['id','org_code','cargo_type','cargo_code','order_id','material_no','supplier_code','unit','qty','location','lot_num','plan_order_no','pick_order_no','pick_order_id','wms_code','created_at','updated_at'];

    /**
     * @var array
     */
    public array $searchable = [
        'order_id' => '=',
'material_no' => '=',
'location' => '=',
'lot_num' => '=',

    ];

    /**
     * 时间格式化
     * @param $date
     * @return mixed
     */
    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i');
    }


}
